package com.woniu.new_orange.staff_module_dong.service.impl;

import com.woniu.new_orange.entity.Permission;
import com.woniu.new_orange.mapper.PermissionMapper;
import com.woniu.new_orange.staff_module_dong.service.PermissionService;
import com.woniu.new_orange.staff_module_dong.vo.PermissionVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Program: new_orange->PermissionServiceImpl
 * @Description:
 * @Author: donghang
 * @Date: 2023-02-01 11:57
 * @Version： 1.0
 **/
@Service
public class PermissionServiceImpl implements PermissionService {

    @Autowired
    private PermissionMapper permissionMapper;

    //  董航  2023/2/1 12:01  获取员工动态菜单
    @Override
    public List<PermissionVo> selMenuByStaffId(Long staffId, Integer parentId) {
        List<PermissionVo> permissionVos = permissionMapper.selMenuByStaffId(staffId, parentId);
        if (permissionVos != null) {
            for (PermissionVo permissionVo : permissionVos) {
                List<PermissionVo> permissionVos1 = selMenuByStaffId(staffId, permissionVo.getPermissionId());
                permissionVo.setChildren(permissionVos1);
            }
        }
        return permissionVos;
    }

    @Override
    public int deleteByPrimaryKey(Long id) {
        return 0;
    }

    @Override
    public int insert(Permission record) {
        return 0;
    }

    @Override
    public int insertSelective(Permission record) {
        return 0;
    }

    @Override
    public Permission selectByPrimaryKey(Long id) {
        return null;
    }

    @Override
    public int updateByPrimaryKeySelective(Permission record) {
        return 0;
    }

    @Override
    public int updateByPrimaryKey(Permission record) {
        return 0;
    }
}
